<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理</title>
</head>

<body>
<?php
include("conn.php");			//包含conn.php文件
if(isset($_POST['id']) and isset($_POST['submit']) and $_POST['submit']=="修改" and $_POST['name']!=null and $_POST['pwd']!=null){
	$update=mysql_query("update tb_user set name='".$_POST['name']."',pwd='".$_POST['pwd']."',sex='".$_POST['sex']."',email='".$_POST['email']."' where id='".$_POST['id']."'",$conn);
if($update){
	echo  "<script> alert('修改成功!'); window.location.href='backstage.php'</script>";
}else{
	echo  "<script> alert('修改失败!'); window.location.href='bs_update1.php'</script>";
	}
}else{
	echo "<script>alert('信息不能为空！'); window.location.href='bs_update1.php'</script>";	
}

?>


</body>
</html>